@extends('backend.template.bootstrap')
@section('content')
<div class="m-b-md">
	<h3 class="m-b-none">用户管理</h3>
</div>
<div class="row">
	<div class="col-lg-12">
		<ul class="breadcrumb">
			<li><a href="{{ url('backend') }}"><i class="fa fa-home"></i> 首页</a></li>
			<li><a href="{{ url('backend/members') }}">用户管理</a></li>
			<li class="active">创建用户</li>
		</ul>
	</div>
</div>
@if (Session::has('msg'))
<div class="alert alert-dismissable alert-danger">
	<button type="button" class="close" data-dismiss="alert">×</button>
	<strong>消息提示：</strong> {{ Session::get('msg') }}
</div>
@elseif ($errors->any())
<div class="alert alert-danger" role="alert">
	<button type="button" class="close" data-dismiss="alert">×</button>
	<strong>消息提示：</strong> {{ $errors->first() }}
</div>
@endif
<section class="panel panel-default">
	<header class="panel-heading font-bold">
		@if (!$member->exists) 添加用户 @else
		编辑用户
		@endif
	</header>
	<div class="panel-body">
		@if (!$member->exists)
			{!! Form::open(array('route' => array('members.store'), 'files' => true)) !!}
		@else
			{!! Form::model($member, array('method' => 'PATCH', 'route' => array('members.update', $member->id), 'files' => true)) !!}
		@endif
			<div class="form-group">
				{!! Form::label('avatar', '头像', array('class' => 'control-label')) !!}
				{!! Form::file('avatar', array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				{!! Form::label('nickname', '昵称', array('class' => 'control-label')) !!}
				{!! Form::text('nickname', $member->nickname, array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				{!! Form::label('cellphone', '手机号', array('class' => 'control-label')) !!}
				{!! Form::text('cellphone', $member->cellphone, array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				{!! Form::label('password', '密码', array('class' => 'control-label')) !!}
				{!! Form::text('password', '', array('class' => 'form-control', 'placeholder' => '设置/修改密码')) !!}
			</div>
	  		<div class="form-group">
  				<button type="submit" class="btn btn-primary">
  					立即保存
  				</button>
				<a href="{{ url('backend/members') }}" class="btn btn-default">返回</a>
	  		</div>
		{!! Form::close() !!}
	</div>
</section>
@stop